fi.internetix.validation.ValidationDelegatorVault =
  /** @lends fi.internetix.validation.ValidationDelegatorVault# */ 
  {
  /**
   * @class Static class for storing validation delegators
   * @constructs
   */  
  initialize: function () { }, 
  getDelegator: function (field) {
    return this._delegators.get(this._generateFieldName(field));
  },
  setDelegator: function (field, validationDelegator) {
    if (!this.getDelegator(field)) {
      this._delegators.set(this._generateFieldName(field), validationDelegator);
    } 
  },
  releaseDelegator: function (field) {
    var delegator = this.getDelegator(field);
    if (delegator) {
      this._delegators.unset(this._generateFieldName(field));
      delegator.deinitialize();
      delete delegator;
    }
  },
  getDelegators: function () {
    return this._delegators.values();
  },
  getFormDelegators: function (formElement) {
    var delegators = new Array();
    
    var allDelegators = this.getDelegators();
    for (var i = 0, l = allDelegators.length; i < l; i++) {
      if (allDelegators[i].insideForm(formElement))
        delegators.push(allDelegators[i]);
    }
    
    return delegators;
  },
  _generateFieldName: function (field) {
    return field.identify();
  },
  _delegators: new Hash()
};